<?php
error_reporting(0);
$page="openid.php";
$con = mysql_connect("localhost","root","ROOT");
if (!$con)
{
 die('连接数据库失败: ' . mysql_error());
}
mysql_select_db("hy_user", $con);
$sql="INSERT INTO hy_wx_vip (hy_vip, openid)
VALUES
('$_POST[hy_vip]','$_POST[openid]')";
if (!mysql_query($sql,$con))
{
 die('错误: ' . mysql_error());
}
//echo "添加一条记录";
echo "<script>alert('绑定成功');window.location = \"".$page."\";</script>"; 
mysql_close($con)

?>